package com.ita.util;

import java.util.ArrayList;
import java.util.Set;
import java.util.TreeSet;

import com.ita.entity.Customer;
import com.ita.entity.IdComparator;

public class PrinterHelper {

	public static void print(Set<Customer> set) {

		for (Customer c : set) {
			System.out.print("id:" + c.getId() + "\t");
			System.out.print("name:" + c.getName() + "\t");
			System.out.print("sex:" + c.getSex() + "\t");
			System.out.print("birthday:" + c.getBirthday() + "\t");
			System.out.print("email:" + c.getEmail() + "\t");
			System.out.println();
		}

	}

	public static void printXML(Set<Customer> set) {
		System.out.println("<Customers>");
		for (Customer customer : set) {
			System.out.println("\t<Customer id=\"" + customer.getId() + "\">");
			System.out.println("\t\t<name>" + customer.getName() + "</name>");
			System.out.println("\t\t<birth>" + customer.getBirthday() + "</birth>");
			System.out.println("\t\t<sex>" + customer.getSex() + "</sex>");
			System.out.println("\t\t<email>" + customer.getEmail() + "</email>");
			System.out.println("\t</Customer>");
		}
		System.out.println("</Customers>");

	}

}
